package yjbo.yy.yjboratingbar;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.RatingBar;

public class MainActivity extends AppCompatActivity {
    ColoredRatingBar ratingBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ratingBar = (ColoredRatingBar) findViewById(R.id.coloredRatingBar4);
        ratingBar.setNumStars(6);
        ratingBar.setRating(1.2f);
        ratingBar.setIndicator(true);//屏蔽点击事件
        ratingBar.setOnRatingBarChangeListener(new ColoredRatingBar.OnRatingBarChangeListener() {

            @Override
            public void onRatingChanged(ColoredRatingBar ratingBar, float rating,
                                        boolean fromUser) {
            }
        });
    }
}
